﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="PhotoGallery.aspx.cs" Inherits="Marta.buchalska.wesele.Admin.PhotoGallery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:LinqDataSource ID="SelectPhotoCategoryDataSource" runat="server" ContextTypeName="Marta.buchalska.wesele.DataModel.WeedingDBDataContext"
        EntityTypeName="" TableName="Photo_categories" EnableDelete="true">
    </asp:LinqDataSource>
    <br />
    <hr />
    <ul>
        <li><a href="NewAlbum.aspx">Dodaj nową kategorię</a></li>
        <li><a href="NewGallery.aspx">Dodaj nową galerie</a></li>
    </ul>
    <hr />
    <asp:LinqDataSource ID="GalleryList" runat="server" ContextTypeName="Marta.buchalska.wesele.DataModel.WeedingDBDataContext"
        EntityTypeName="" TableName="Photo_galleries">
    </asp:LinqDataSource>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SelectPhotoCategoryDataSource"
        DataKeyNames="ID" OnRowDeleting="GridView1_RowDeleting">
        <Columns>
            <asp:CommandField DeleteText="Usuń kategorię" ShowDeleteButton="True" ButtonType="Image"
                DeleteImageUrl="~/Styles/images/cancel_16.png" />
            <asp:BoundField DataField="Name" HeaderText="Nazwa kategorii" SortExpression="Name" />
            <asp:TemplateField HeaderText="Galerie w kategorii">
                <ItemTemplate>
                    <asp:ListView runat="server" DataSource='<%#Eval("Photo_galleries") %>'>
                        <ItemTemplate>
                            <asp:HyperLink runat="server" ID='Link' Text='<%# Eval("Name") %>' NavigateUrl='<%# Eval("ID", "~/admin/GalleryEdit.aspx?gid={0}") %>'></asp:HyperLink><asp:Label
                                Text=" | " runat="server" />
                        </ItemTemplate>
                    </asp:ListView>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>
